// SessionRegistry.java
package cn.sky.demo.test;

import javax.servlet.http.HttpSession;
import java.util.concurrent.ConcurrentHashMap;
import org.springframework.stereotype.Component;

@Component
public class SessionRegistry {
    
    private final ConcurrentHashMap<String, HttpSession> sessions = new ConcurrentHashMap<>();
    
    public void registerSession(String sessionId, HttpSession session) {
        sessions.put(sessionId, session);
    }
    
    public HttpSession getSession(String sessionId) {
        return sessions.get(sessionId);
    }
    
    public void removeSession(String sessionId) {
        sessions.remove(sessionId);
    }
}
